#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
using namespace std;

class Solution {
public:
    int numOfSubarrays(vector<int>& arr, int k, int threshold)
    {
        int ret = 0;
        int mid = 0;
        for (int i = 0; i < arr.size(); i++)
        {
            mid += arr[i];
            if (i < k - 1)
                continue;
            if ((mid / k) >= threshold)
                ret++;
            mid -= arr[i - k + 1];
        }
        return ret;

    }
};